<template>
  <ActivityPhonePreview>
    <div class="bg_phone">
      <el-header class="header">
        <!-- <span class="icon"><el-icon><close-bold /></el-icon></span> -->
        <div class="title">{{ formInfo.title }}</div>
      </el-header>
      <div class="content_box">
        <div class="content_box_con">
          <div class="time">
            {{ tiems }}
          </div>
          <div class="inp_box">
            首拆获￥<span class="inp_box-price" v-if="formInfo.first_type == 1">{{ formInfo.first_value[0] }}元</span>
            <span v-if="formInfo.first_type == 2">{{ formInfo.first_value[0] }}元 - {{ formInfo.first_value[1] }}元</span>
            <span v-if="formInfo.first_type == 3">{{ (formInfo.first_value[0] * formInfo.red_envelope_money) / 100 }}元 - {{ (formInfo.first_value[1] * formInfo.red_envelope_money) / 100 }}元</span>
          </div>
          <div class="inp_box_two">
            <span>还有{{ money?.toFixed(2) }}元红包正在路上~</span>
          </div>
          <div class="inp_box_therr">
            <span>继续召唤{{ formInfo.help_num }}位好友拆红包</span><br />
            <span class="inp_box_therr-desc">拆完后即可收入囊中</span>
          </div>
        </div>
      </div>
    </div>
  </ActivityPhonePreview>
</template>
<script setup lang="ts">
import { ref, reactive, computed } from 'vue'
import ActivityPhonePreview from '../index.vue'

const props = defineProps(['formInfo', 'tiems'])

const money = computed(() => {
  if (props.formInfo.first_type == 1) {
    return props.formInfo.red_envelope_money - props.formInfo.first_value[0]
  } else if (props.formInfo.first_type == 2) {
    return props.formInfo.red_envelope_money - props.formInfo.first_value[1]
  } else if (props.formInfo.first_type == 3) {
    return (props.formInfo.red_envelope_money * props.formInfo.first_value[1]) / 100
  }
})

</script>
<style lang="scss" scoped>
.bg_phone {
  width: 100%;
  min-height: 603px;
  box-sizing: border-box;
  overflow: hidden;
  justify-content: center;
  background-color: #f1f7f9;
  font-size: 12px;
  color: #000;
  .el-header {
    display: flex;
    width: 100%;
    height: 28px;
    padding: 10px 0 0 8px;
    text-align: center;
    background-color: #fff;
    .title {
      background: #ffffff;
      border-radius: 1px;
      border-bottom: 1px solid #f5f5f5;
      position: relative;
      text-align: center;
      font-size: 16px;
      font-family: STHeitiSC-Medium, STHeitiSC;
      font-weight: 500;
      color: #000000;
      height: 42px;
      line-height: 44px;
      text-align: center;
      position: absolute;
      top: 0;
      right: 0;
      text-align: center;
      width: 100%;
      z-index: 1;
    }
  }

  .content_box {
    position: relative;
    height: 603px;
    background-image: url('@/assets/chatDetails/fission_bg.png');
    background-size: 100%;
    background-repeat: no-repeat;
    .time {
      position: absolute;
      color: #ffffff;
      font-size: 16px;
      top: 160px;
      left: 50%;
      transform: translateX(-50%);
    }
    .inp_box {
      position: absolute;
      top: 335px;
      left: 50%;
      transform: translateX(-50%);
      line-height: 18px;
      text-align: center;
      color: #ff3e4a;
      border-radius: 12px;
      font-size: 16px;
      .inp_box-price {
        font-size: 20px;
      }
    }
    .inp_box_two {
      position: absolute;
      top: 360px;
      left: 50%;
      transform: translateX(-50%);
      line-height: 16px;
      text-align: center;
      color: #ff3e4a;
      border-radius: 12px;
      font-size: 16px;
    }
    .inp_box_therr {
      position: absolute;
      top: 396px;
      left: 50%;
      transform: translateX(-50%);
      line-height: 18px;
      text-align: center;
      color: #ff3e4a;
      border-radius: 12px;
      font-size: 16px;
      .inp_box_therr-desc {
        font-size: 14px;
        line-height: 26px;
      }
    }
  }
}

</style>
